var assert = require('assert');
var should = require('should');
var util = require('util');
var zlib = require('zlib');
var _ = require('lodash');
var buildConf = require('../../app/config/buildConf');
var dataApi = require('../../app/libs/dataApi');
var buildType = require('../../app/consts/buildType');

suite('buildConf', function () {
    // suite('getBuildTypeConf', function () {
    //     test('获取建筑数据', function () {
    //         buildConf.getBuildTypeConf(101);
    //     });

    //     test('获取建筑数据', function () {
    //         buildConf.getBuildTypeConf(10101);
    //     });
    // });

    // suite('getBuildLvConf', function () {
    //     test('获取建筑等级类型配置', function () {
    //         buildConf.getBuildTypeConf(1, 1);
    //     });
    // });

    // suite('getBuildLvConf', function () {
    //     test('建筑等级配置', function () {
    //         // for (var x=0;x<100000;x++) {
    //              buildConf.getBuildLvConf(buildType.SOLDIERCOLLEGE, 5);
    //         // }
    //     });
    // });

    // suite('建筑大类', function () {
    //     test('getBuildUseType', function () {
    //         for (var x=0;x<100000;x++) {
    //             buildConf.getBuildUseType(buildType.SOLDIERCOLLEGE);
    //         }
    //     });
    // });

    // suite('获取建筑类型配置', function () {
    //     test('getBuildTypeConf', function () {
    //         // for (var x=0;x<100000;x++) {
    //             buildConf.getBuildTypeConf(buildType.SOLDIERCOLLEGE);
    //         // }
    //     });
    // });

    // suite('获取可建造数量', function () {
    //     test('getBuildMaxNum', function () {
    //         for (var x=0;x<1000000;x++) {
    //             buildConf.getBuildMaxNum(5, buildType.SOLDIERCOLLEGE);
    //         }
    //     });
    // });

    // suite('获取可建造防御建筑数量', function () {
    //     test('getDefBuildMaxNum', function () {
    //         // for (var x=0;x<1000000;x++) {
    //             buildConf.getDefBuildMaxNum(5, buildType.ARROW_TOWER);
    //         // }
    //     });
    // });

    // suite('getBuildUseType', function () {
    //     test('获取建筑数据', function () {
    //         buildConf.getBuildUseType(10101);
    //     });

    //     test('获取建筑数据', function () {
    //         buildConf.getBuildUseType(101);
    //     });
    // });

    suite('getBuildMaxNum', function () {
        test('获取建筑最大可建筑的数量', function () {
            assert.notEqual(buildConf.getBuildMaxNum(8, buildType.NEXUS), null);
            assert.notEqual(buildConf.getBuildMaxNum(8, buildType.MINE), null);
            assert.notEqual(buildConf.getBuildMaxNum(8, buildType.FARM), null);
            assert.notEqual(buildConf.getBuildMaxNum(8, buildType.BARN), null);
            assert.notEqual(buildConf.getBuildMaxNum(8, buildType.MARKET), null);
            assert.notEqual(buildConf.getBuildMaxNum(8, buildType.SMITHY), null);
            assert.notEqual(buildConf.getBuildMaxNum(8, buildType.HEROCOLLEGE), null);
            assert.notEqual(buildConf.getBuildMaxNum(8, buildType.SOLDIERCOLLEGE), null);
            assert.notEqual(buildConf.getBuildMaxNum(8, buildType.ACADEMY), null);
            assert.notEqual(buildConf.getBuildMaxNum(8, buildType.WISHTREE), null);
            assert.notEqual(buildConf.getBuildMaxNum(8, buildType.UNION), null);
        });
    });

    // suite('getDefBuildMaxNum', function () {
    //     test('获取建筑最大可建筑的数量', function () {

    //         // 塔
    //         assert.equal(buildConf.getDefBuildMaxNum(1, buildType.ARROW_TOWER) === 5, true);
    //         assert.equal(buildConf.getDefBuildMaxNum(1, buildType.CANNON_TOWER) === 5, true);
    //         assert.equal(buildConf.getDefBuildMaxNum(1, buildType.LIGHT_TOWER) === 5, true);
    //         assert.equal(buildConf.getDefBuildMaxNum(1, buildType.ICE_TOWER) === 5, true);
    //         assert.equal(buildConf.getDefBuildMaxNum(1, buildType.CROSSBOW_TOWER) === 5, true);
    //         assert.equal(buildConf.getDefBuildMaxNum(1, buildType.DRAGON_TOWER) === 5, true);
    //         assert.equal(buildConf.getDefBuildMaxNum(1, buildType.SNOW_TOWER) === 5, true);
    //         assert.equal(buildConf.getDefBuildMaxNum(1, buildType.ELECTRIC_TOWER) === 5, true);

    //         // // 障碍物
    //         // assert.equal(buildConf.getDefBuildMaxNum(1, buildType.ROAD_BLOCK) === 3, true);
    //         // assert.equal(buildConf.getDefBuildMaxNum(1, buildType.LANDMINE) === 3, true);
    //     });
    // })
});
